package it.koutifaris.travianmap.view.distances;

import it.koutifaris.travianmap.R;
import it.koutifaris.travianmap.context.ContextRetreiver;
import it.koutifaris.travianmap.model.Village;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class DistancesActivity extends Activity {

	private static class Arguments {
		private static Village from;
		private static Village to;
	}

	public static void startActivity(Village from, Village to) {
		Arguments.from = from;
		Arguments.to = to;

		Activity currentActivity = ContextRetreiver.contextRetreiver().getCurrentContext().getActivity();
		Intent intent = new Intent(currentActivity, DistancesActivity.class);
		currentActivity.startActivity(intent);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		ContextRetreiver.contextRetreiver().setCurrentContext(this);

		setContentView(R.layout.distances_view);

		initView();
	}

	private void initView() {
		new DistancesViewInitializer(this, Arguments.from, Arguments.to).initView(findViewById(android.R.id.content));
	}
}
